/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package sislab;

import Control.VerificaRede;
import View.jfTelaLogin;
import View.jfTelaPrincipal;
import java.util.ArrayList;
import javax.swing.UIManager;

/**
 *
 * @author awolf1
 */
public class Main {

    public static jfTelaPrincipal tp;
    public static String versao = "0.1";

    public static void main(String[] args) {
        aplicarLook();
        new jfTelaPrincipal().setVisible(true);
    }

    public static void main1(String[] args) {
        boolean inicia = false;
        for (int i = 0; i < args.length; i++) {
            if (args[i].equals("--version")) {
                System.out.println("Versao Atual do sistema:\n" + versao);
                inicia = false;
            }
        }
        if (inicia) {
            aplicarLook();
            jfTelaLogin tl = new jfTelaLogin();
            tl.setVisible(true);
        }


        VerificaRede vr = new VerificaRede();
        vr.setIntervalo("10.3.18.10", "10.3.19.40");
        vr.setMaxThread(10);
        vr.verifica();

        do {
            try {
                Thread.sleep(2000);
            } catch (Exception ex) {
            }
            System.out.println("nThreads = " + vr.getnThreads());
        } while (vr.isVerificando());

        System.out.println("Ligados");
        ArrayList<String> comps = vr.getComputadoresLigados();
        for (int i = 0; i < comps.size(); i++) {
            System.out.println(comps.get(i));
        }

        System.out.println("Desligados");
        comps = vr.getComputadoresDesligados();
        for (int i = 0; i < comps.size(); i++) {
            System.out.println(comps.get(i));
        }
    }

    public static void aplicarLook() {
        try {
            //UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");#
            UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());

        } catch (Exception e) {
        }
    }
}
